﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

using KKey = System.Windows.Input.Key;

namespace WindowSwitcher.Behaviors
{
    public class KeyCollection : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private KKey key;
        private bool attach;

        public KKey Key
        {
            get { return key; }
            set 
            {
                if (value != this.key)
                {
                    this.key = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private bool enable;
        public bool Enabled
        {
            get { return this.enable; }
            set 
            {
                if (value != this.enable)
                {
                    this.enable = value;
                    NotifyPropertyChanged();
                }
            }
        }

        public bool IsAttached
        {
            get { return this.attach; }
            set
            {
                if (value != this.attach)
                {
                    this.attach = value;
                    NotifyPropertyChanged();
                }
            }
        }

        private void NotifyPropertyChanged([CallerMemberName] string propertyName = null)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
